// Math.cs

using System;

namespace Mono.Algorithm
{
	public partial class Algorithm
	{
		/// <summary>
		/// Calculates the factorial of a given number
		/// </summary>
		/// <param name="number">The number to calculate the factorial for</param>
		public static int Factorial(int number)
		{
			int sum = number;

			for (int i = number - 1; i > 0; i--)
			{
				sum *= i;
			}

			return sum;
		}
	}
}
